import { createApp } from 'vue'
import App from './App.vue'

import ElementPlus from 'element-plus'
// import {ElButton,ElDatePicker} from 'element-plus'
import 'element-plus/dist/index.css'
import router from './router'
import UUIDPlugin from './util/uuid.js';
const app = createApp(App)

app.use(UUIDPlugin);
app.use(ElementPlus)
app.use(router)

app.directive('role', {
    beforeMount(el, binding, vnode) {
      const roles = vnode.props.roles;
      const userRole = binding.value;
  
      if (!roles.includes(userRole)) {
        el.style.display = 'none';
      }
    },
  });

// 按需引入
// app.use(ElButton)
// app.use(ElDatePicker)

//全局注册 echart

app.mount('#app')
